<meta charset="UTF-8">

<?php

include_once("functions/db_manipulate.php");
if (!init()) {
    redirect('login.php');
}

$link_id = connectDB();

startTransaction();

$resultSet = mysql_query("DELETE FROM usrtopic WHERE uid='" . $_SESSION['id'] . "' AND tid='" . $_GET['tid'] . "'");

if ($resultSet) {
    commitTransaction();
    redirect($_SERVER['HTTP_REFERER']);
} else {
    rollbackTransaction();
}
?>